﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

using Xc.DataAccess.AepCoapCore.Models;
using Xc.DataAccess.Core;

namespace Xc.Logics.AepCoap.ViewModels
{
    public class MainViewModel : ViewModelBase
    {
        ObservableCollection<DeviceInfoList> deviceInfoLists = new ObservableCollection<DeviceInfoList>();
        public ObservableCollection<DeviceInfoList> DeviceInfoLists
        {
            get => deviceInfoLists; set
            {
                if (deviceInfoLists == value)
                {
                    return;
                }

                deviceInfoLists = value;
                RaisedPropertyChanged();
            }
        }
        public int DeviceInfoCount
        {
            get => deviceInfoCount; set
            {
                deviceInfoCount = value;
                RaisedPropertyChanged();
            }
        }
        ObservableCollection<AddDeviceModel> importDevices = new ObservableCollection<AddDeviceModel>();
        public ObservableCollection<AddDeviceModel> ImportDevices
        {
            get => importDevices;
            set
            {
                if (importDevices == value)
                {
                    return;
                }

                importDevices = value;
                RaisedPropertyChanged();
                RaisedPropertyChanged(nameof(TotalCount));
            }
        }
        public int TotalCount => ImportDevices.Count;
        int index = 0;
        public int Index
        {
            get => index;
            set
            {
                if (index == value)
                {
                    return;
                }

                index = value;
                RaisedPropertyChanged();
            }
        }
        Visibility visibility = Visibility.Collapsed;
        private int deviceInfoCount;

        public Visibility Visibility
        {
            get => visibility;
            set
            {
                if (visibility == value)
                {
                    return;
                }

                visibility = value;
                RaisedPropertyChanged();
            }
        }
    }
}
